from common import router
from common.utils import TransferBaseHandler
from models.stock_transfer import TransferOutConfig


@router.Route("/api/v1/test")
class TransferSourceListHandler(TransferBaseHandler):
    async def get(self, *args, **kwargs):
        market = self.get_argument("market")
        sources_list = TransferOutConfig.query_list(self.db_slave,
                                                    market=market)
        result = dict(is_succ=True, data=sources_list)
        return self.json_response(result)